package study.maintest;

import groovy.util.logging.Slf4j;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import study.config.AppConfig;
import study.javaConstructorTest.classPackage.C;

/**
 * @author: chengchao
 * @description:
 * @date: create in 2021/9/10
 **/
@Slf4j
public class Test {

    public static void main(String[] args) {


        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);
        DefaultListableBeanFactory defaultListableBeanFactory = applicationContext.getDefaultListableBeanFactory();

        defaultListableBeanFactory.getBean(C.class);
        /*OrderCityServiceImpl orderCityService1 = defaultListableBeanFactory.getBean(OrderCityServiceImpl.class);
        orderCityService1.printInfo();*/

        //DefaultSingletonBeanRegistry defaultSingletonBeanRegistry = (DefaultSingletonBeanRegistry) defaultListableBeanFactory.getBean("defaultSingletonBeanRegistry");
        /*ConfigurableListableBeanFactory configurableListableBeanFactory = applicationContext.getBeanFactory();
        OrderCityServiceImpl orderCityService2 = (OrderCityServiceImpl) configurableListableBeanFactory.getBean("orderCityServiceImpl");
        orderCityService2.printInfo();*/
    }
}
